#pragma once

#ifdef MEDIA_PUSH_EXPORTS 
#define VIDEO_ACTION __declspec(dllexport) 
#else 
#define VIDEO_ACTION __declspec(dllimport) 
#endif 

#include <list>
#include <string>

class VideoCaptureTask;
class VideoEncodeTask;
class VideoCapureOut;
class Receive_handler;
class VIDEO_ACTION VideoAction
{
	friend class MediaPushImpl;
	friend class AsynchExecTask;
public:
	VideoAction(const std::string &camera_name, const std::string &info, unsigned int bps = 300, unsigned int fps = 10, VideoCapureOut *pVideoCapureOut = NULL);
	virtual ~VideoAction();
public:
	static std::list<std::string>  get_camera_list();
	static std::list<std::string> get_camera_info_list(const std::string &camera_name);
private:
	virtual bool OnInit();
	virtual bool OnStart();
	virtual bool OnStop();
	std::string     getX264Header();
	std::string     getX264SeiInfo();
	Receive_handler *getCaptureHandle();
	float getFrameDuration();
private:
	unsigned int  m_ikbps;
	unsigned int  m_ifps;
	std::string			*m_strCameraName;
	std::string			*m_strCameraInfo;

	VideoCaptureTask    *m_oVideoCaptureTask;
	VideoEncodeTask     *m_oVideoEncodeTask;

	VideoCapureOut		*m_oVideoCapureOut;
};

